home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat2 / standard / mpin.z / mpin
Encoding:
Text File  |  2002-10-03  |  4.6 KB  |  133 lines

  1.  
  2.  
  3.  
  4. MMMMPPPPIIIINNNN((((2222))))                                                                MMMMPPPPIIIINNNN((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      mpin, munpin - lock pages in memory
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      iiiinnnntttt mmmmppppiiiinnnn ((((vvvvooooiiiidddd ****aaaaddddddddrrrr,,,, ssssiiiizzzzeeee____tttt))));;;;
  13.  
  14.      iiiinnnntttt mmmmuuuunnnnppppiiiinnnn ((((vvvvooooiiiidddd ****aaaaddddddddrrrr,,,, ssssiiiizzzzeeee____tttt))));;;;
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      _mmmm_pppp_iiii_nnnn reads into memory all pages over the range (_a_d_d_r, _a_d_d_r + _l_e_n), and
  18.      locks the pages into memory.  Associated with each locked page is a
  19.      counter which is incremented each time the page is locked.  The super-
  20.      user can lock as many pages as it wishes, other users are limited to a
  21.      configurable per process maximum.
  22.  
  23.      _mmmm_uuuu_nnnn_pppp_iiii_nnnn decrements the lock counter associated with the pages over the
  24.      range (_a_d_d_r, _a_d_d_r + _l_e_n).  Pages whose counters are zero are available to
  25.      be swapped out at the system's discretion.
  26.  
  27.      _mmmm_pppp_iiii_nnnn or _mmmm_uuuu_nnnn_pppp_iiii_nnnn will fail if one or more of the following are true:
  28.  
  29.      [EINVAL]       The addresses specified by (_a_d_d_r, _a_d_d_r + _l_e_n) are not
  30.                     mapped into the user's address space.
  31.  
  32.      [EAGAIN]       There was insufficient lockable memory to lock the entire
  33.                     address range (_a_d_d_r, _a_d_d_r + _l_e_n).  This may occur even
  34.                     though the amount requested was less than the system-
  35.                     imposed maximum number of locked pages.
  36.  
  37.      [EBUSY]        _mmmm_uuuu_nnnn_pppp_iiii_nnnn will fail with this error if the address range
  38.                     specified has some active _IIII_////_OOOO initiated by some other
  39.                     process belonging to same share group.
  40.  
  41.      [ENOMEM]       The caller was not super-user and the number of pages to
  42.                     be locked exceeded the per process limit {_P_L_O_C_K__M_A_X} [see
  43.                     _iiii_nnnn_tttt_rrrr_oooo(2)].
  44.  
  45.      [ENOMEM]       The total number of pages locked by the caller would
  46.                     exceed the maximum resident size for the process [see
  47.                     _s_e_t_r_l_i_m_i_t(2)].
  48.  
  49.      [ENOSPC]       The address range (_a_d_d_r, _a_d_d_r + _l_e_n) contains a memory-
  50.                     mapped file, and there is insufficient space on the device
  51.                     to allocate the entire file.
  52.  
  53. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  54.      intro(2), getrlimit(2), mlock(3C), mlockall(3C), plock(2), ulimit(2).
  55.  
  56. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  57.      Upon successful completion, _mmmm_pppp_iiii_nnnn and _mmmm_uuuu_nnnn_pppp_iiii_nnnn return 0.  Otherwise, a value
  58.      of -1 is returned and _e_r_r_n_o is set to indicate the error.
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. MMMMPPPPIIIINNNN((((2222))))                                                                MMMMPPPPIIIINNNN((((2222))))
  71.  
  72.  
  73.  
  74. WWWWAAAARRRRNNNNIIIINNNNGGGG
  75.      The functions _mmmm_pppp_iiii_nnnn_////_mmmm_uuuu_nnnn_pppp_iiii_nnnn and _mmmm_llll_oooo_cccc_kkkk_////_mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk provide similar
  76.      functionality.  The major difference between the two sets is that
  77.      _mmmm_pppp_iiii_nnnn_////_mmmm_uuuu_nnnn_pppp_iiii_nnnn maintains a per page lock counter and _mmmm_llll_oooo_cccc_kkkk_////_mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk does not.
  78.      Developers should choose the set that best suites their application and
  79.      stick with it, as mixing the interfaces may result in unexpected
  80.      behavior.
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.